# vim:ts=4:sw=4:noet:
""" Documentation window """

import wx
import logging

from c.ui.wxw.common import loadWxImage, getProperPath
from c.base.platform import Platform

class IntroWindow(wx.Dialog):
	def __init__(self, parent): 
		wx.Dialog.__init__(self, parent)
		self.parent = parent

		bmp = wx.Bitmap(getProperPath(Platform.getDataFilePath("intro.png")))
		self.bitmap = wx.StaticBitmap(self, wx.ID_ANY, bmp, (0, 0))

		self.SetSize((bmp.GetWidth(), bmp.GetHeight()))
		parent.Fit()

		bparent = self
		if wx.Platform=="__WXMSW__":
			bparent = self.bitmap

		self.buttonTut = wx.Button(bparent, -1,
				label='Start Tutorial', pos=(30, 180))
		self.buttonTut.Bind(wx.EVT_BUTTON, self.buttonTut_click)

		self.buttonNew = wx.Button(bparent, -1,
				label='New Project', pos=(170, 180))
		self.buttonNew.Bind(wx.EVT_BUTTON, self.buttonNew_click)
		self.Show()
		self.CentreOnParent()

	def buttonTut_click(self, event):
		self.Show(False)
		self.parent.onTutorialButton(event)

	def buttonNew_click(self, event):
		self.Show(False)
		self.parent.onNewProjectButton(event)

